<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table, td {
            border: solid;
        }
    </style>
</head>
<body>
    <!-- 
        visibility 设置元素的隐藏或者显示
        visible（默认） 显示
     -->
    <span style="visibility: visible;">span1</span>
    <span>span2</span>
    <hr>
    <!-- 
        hidden 元素被隐藏 但是元素本身文档流的位置依然存在
     -->
    <span style="visibility: hidden;">span1</span>
    <span>span2</span>
    <div style="visibility: hidden;">div1</div>
    <div>div2</div>
    <hr>
    <!-- 
        collapse 元素被隐藏 但是元素本身文档流的位置依然存在
     -->
    <span style="visibility: collapse;">span1</span>
    <span>span2</span>
    <hr>
    <div style="visibility: collapse;">div1</div>
    <div>div2</div>
    <table>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
        </tr>
        <tr style="visibility: hidden;">
            <td>1</td>
            <td>2</td>
            <td>3</td>
        </tr>
        <tr>
            <td style="display: none;">1</td>
            <td style="visibility: hidden;">2</td>
            <td style="visibility: collapse;">3</td>
        </tr>
    </table>
</body>
</html>